package com.itheima.a06myprintstream;

import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.PrintStream;
import java.nio.charset.Charset;

public class PrintStreamDemo1 {
    public static void main(String[] args) throws FileNotFoundException {
        //熟悉字节打印流

        //创建对象
        PrintStream ps=new PrintStream(new FileOutputStream("myio\\a.txt"),true, Charset.forName("UTF-8"));
        //写入
        ps.println("Hello World");
        ps.println(97);
        ps.printf("sss%s","true");
        ps.print(99);
        //关流
        ps.close();
    }
}
